inherited dm_produtomarca: Tdm_produtomarca
  OldCreateOrder = True
  Left = 540
  Top = 211
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  m.cod_marca,'
      '  m.descricao,'
      '  m.situacao,'
      '  case'
      '    when m.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      '  m.data_cad,'
      '  m.data_alteracao,'
      
        ' (select count(p.cod_produto) from produto p where p.lig_cod_cat' +
        'egoria = m.cod_marca) as total_prod'
      'from PRODUTO_MARCA m')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_MARCA: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_MARCA'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaTOTAL_PROD: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_PROD'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_produto_marca,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_MARCA: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_MARCA'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'marca'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  m.cod_marca,'
      '  m.descricao,'
      '  m.situacao,'
      '  m.data_cad,'
      '  m.data_alteracao'
      'from PRODUTO_MARCA m'
      'where m.cod_marca = :marca')
  end
end
